﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ProjectShare
{
    public class SearchBase
    {
        /// <summary>
        /// 默认Desc排序
        /// </summary>
        public bool IsDesc { get; set; }

        private int _pageSize;
        private int _pageNumber;
        public int PageSize
        {
            get
            {
                if (_pageSize == 0)
                {
                    _pageSize = 20;
                }
                return _pageSize;
            }
            set
            {
                _pageSize = value;
            }
        }
        public int PageNumber
        {
            get
            {
                if (_pageNumber == 0)
                {
                    _pageNumber = 1;
                }
                return _pageNumber;
            }

            set
            {
                _pageNumber = value;
            }
        }
        public int MinRow
        {
            get
            {
                if (_pageNumber == 0)
                {
                    _pageNumber = 1;
                }
                return (PageNumber - 1) * PageSize+1;
            }
        }
        public int MaxRow
        {
            get
            {
                return PageNumber * PageSize;
            }
        }
    }
}
